<script setup>

//定义的各种数据
import {reactive, ref} from "vue";
import xx from "@/axios/xx";
import {ElMessage, genFileId} from "element-plus";
import axios, {request} from "axios";
import {Delete, Download, Edit, Plus, Search, Upload} from "@element-plus/icons-vue";

let info = reactive({
  list:[],//列表数据
  form:{},//表单数据
  dialogVisible:false,//对话框数据
  pageNum: 1, //当前页
  pageSize: 5, //每页大小
  total: 0,//总条数
  isAdd: true,//增加和修改标识
  loanTypeList:[],//分类信息所有数据
  bankList:[],//银行所有数据
  userInfoList:[],
  loanApplicationList:[],
})


//查询列表信息
const load = () => {
  xx.get('/repaymentMonitoring/listToAdm',{
    params:{
      pageNum:info.pageNum,
      pageSize:info.pageSize,
    }
  }).then(res =>{
    console.log(res)
    info.list = res.data.list
    //当前页
    info.pageNum = res.data.pageNum;
    //每页大小
    info.pageSize = res.data.pageSize;
    //总条数
    info.total = res.data.total;

  })
}

load()

//分页当前页改变
const handleCurrentChange = (pageNum) => {
  info.pageNum = pageNum;
  load()
}

//分页大小改变
const handleSizeChange = (pageSize) => {
  info.pageSize = pageSize;
  load()
}


//关闭对话框，清空数据
const handleClose = () => {
  info.form = {}
  info.dialogVisible = false
}

</script>

<template>
  <div class="applicationStatus">
    <br>
    <!--表格信息-->
    <el-table :data="info.list" border stripe style="width: 100%">
      <el-table-column fixed prop="loanApplication.userInfo.username" align="center" label="贷款申请账号" width="180" />
      <el-table-column fixed prop="loanApplication.userInfo.creditRank" align="center" label="信用等级" width="100" />
      <el-table-column fixed prop="repaymentAmount" align="center" label="已还款金额(￥)" width="100" />
      <el-table-column fixed prop="loanApplication.loanType.money" align="center" label="贷款金额(￥)" width="100" />
      <el-table-column fixed prop="loanApplication.startDate" align="center" label="贷款日期" width="180" />
      <el-table-column fixed prop="loanApplication.deadline" align="center" label="还款日期" width="180" />
      <el-table-column prop="loanApplication.loanType.loanTypeName" align="center" label="贷款类型名称" width="180" />
      <el-table-column prop="loanApplication.loanType.description" align="center"label="描述信息" />
      <el-table-column fixed="right" prop="overdueStatus" align="center" label="审核状态" width="100"  />
    </el-table>
    <!--分页-->
    <br>
    <div class="demonstration"></div>
    <el-pagination
        v-model:current-page="info.pageNum"
        v-model:page-size="info.pageSize"
        :page-sizes="[5, 10, 15, 20]"
        :small="false"
        :disabled="false"
        :background="true"
        layout="total, sizes, prev, pager, next, jumper"
        :total="info.total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
    />
  </div>
</template>

<style scoped>

</style>